home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3dm / old-compression / cl_mpeg1.z / cl_mpeg1
Encoding:
Text File  |  2002-10-03  |  18.5 KB  |  397 lines

  1.  
  2.  
  3.  
  4. ccccllll____mmmmppppeeeegggg1111((((3333ddddmmmm))))                                                    ccccllll____mmmmppppeeeegggg1111((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      cl_mpeg1 - MPEG-1 schemes in the Compression Library
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////ccccllll....hhhh>>>>
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      The MPEG compression standard, mpeg(4), is supported in the Compression
  16.      Library, CLintro(3dm), with two schemes
  17.  
  18.      1. CCCCLLLL____MMMMPPPPEEEEGGGG1111____VVVVIIIIDDDDEEEEOOOO____SSSSOOOOFFFFTTTTWWWWAAAARRRREEEE     video compressor/decompressor
  19.      2. CCCCLLLL____MMMMPPPPEEEEGGGG1111____AAAAUUUUDDDDIIIIOOOO____SSSSOOOOFFFFTTTTWWWWAAAARRRREEEE     audio compressor/decompressor
  20.  
  21.      Each scheme is accessed using the basic CL API and parameter set.  This
  22.      man page describes the features supported by these schemes, as well as
  23.      the general CL and MPEG-specific parameters that are relevant for their
  24.      operation.
  25.  
  26.      The Compression Library also provides MPEG audio support through a third
  27.      scheme, CL_MPEG1_AUDIO_AWARE, which uses somewhat different parameters.
  28.      For a discussion of this and other compression schemes from Aware, Inc.,
  29.      see cl_aware(3dm).
  30.  
  31.  
  32. FFFFEEEEAAAATTTTUUUURRRREEEESSSS
  33.      VVVViiiiddddeeeeoooo CCCCoooommmmpppprrrreeeessssssssiiiioooonnnn
  34.           o Cropping and smoothing of input frames
  35.           o High-quality rate control
  36.           o Automatic I-frame insertion at scene changes
  37.  
  38.  
  39.      AAAAuuuuddddiiiioooo CCCCoooommmmpppprrrreeeessssssssiiiioooonnnn
  40.           o Layer I and II support
  41.           o Stereo, joint, dual, and single-channel modes
  42.  
  43.  
  44.  
  45. PPPPRRRROOOOGGGGRRRRAAAAMMMMMMMMIIIINNNNGGGG MMMMPPPPEEEEGGGG
  46.      The two MPEG schemes, CL_MPEG1_VIDEO_SOFTWARE and
  47.      CL_MPEG1_AUDIO_SOFTWARE, are accessed through the standard CL API.  See
  48.      CLintro(3dm) for an overview of the CL calls and their usage.
  49.  
  50.  
  51.      Only _I_m_p_l_i_c_i_t _B_u_f_f_e_r_i_n_g is currently supported for input buffers of video
  52.      and audio decompressors, and for both buffers of video compressors.  This
  53.      model requires that the implicit buffer be created with ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff((((3333ddddmmmm))))
  54.      prior to calling ccccllllDDDDeeeeccccoooommmmpppprrrreeeessssssss((((3333ddddmmmm)))) or ccccllllCCCCoooommmmpppprrrreeeessssssss((((3333ddddmmmm)))).  Once created, the
  55.      same implicit buffer should be used for the lifetime of the processing
  56.      object.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ccccllll____mmmmppppeeeegggg1111((((3333ddddmmmm))))                                                    ccccllll____mmmmppppeeeegggg1111((((3333ddddmmmm))))
  71.  
  72.  
  73.  
  74.    PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  75.      Various parameters are useful for guiding and monitoring MPEG processing.
  76.      These are discussed in several groups : General CL, MPEG-1, MPEG-1 Video,
  77.      and MPEG-1 Audio.
  78.  
  79.  
  80.    PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS :::: GGGGEEEENNNNEEEERRRRAAAALLLL CCCCLLLL
  81.      All of the general CL parameters are described in CLintro(3dm).  Below we
  82.      mention only those for which additional information is useful (such as
  83.      parameter ranges and other constraints).
  84.  
  85.      CCCCLLLL____IIIIMMMMAAAAGGGGEEEE____WWWWIIIIDDDDTTTTHHHH,,,, CCCCLLLL____IIIIMMMMAAAAGGGGEEEE____HHHHEEEEIIIIGGGGHHHHTTTT
  86.           For video compressors, these should be set to match the input
  87.           frame size.  Each dimension has a minimum value of 16 and a
  88.           maximum value of 4080.  For video decompressors, these are
  89.           read-only and match the encoded ("internal") dimensions.
  90.  
  91.      CCCCLLLL____IIIINNNNTTTTEEEERRRRNNNNAAAALLLL____IIIIMMMMAAAAGGGGEEEE____WWWWIIIIDDDDTTTTHHHH,,,, CCCCLLLL____IIIINNNNTTTTEEEERRRRNNNNAAAALLLL____IIIIMMMMAAAAGGGGEEEE____HHHHEEEEIIIIGGGGHHHHTTTT
  92.           For video compressors, these default to the "source input format"
  93.           (SIF), which is 352x240 (CCIR601-525 pixel aspect ratio), 352x288
  94.           (CCIR601-625 pixel aspect ratio), or 320x240 (square pixels).  For
  95.           inputs with other pixel aspect ratios, the closest of these three
  96.           applies.
  97.  
  98.           If cropping is used (see below), the cropped image is scaled to
  99.           the internal dimensions prior to encoding.  The internal width and
  100.           height must each be between 16 and 4080, inclusive, and be a
  101.           multiple of 16.
  102.  
  103.           For video decompressors, these parameters are read-only.
  104.  
  105.      CCCCLLLL____IIIIMMMMAAAAGGGGEEEE____CCCCRRRROOOOPPPP____LLLLEEEEFFFFTTTT,,,, CCCCLLLL____IIIIMMMMAAAAGGGGEEEE____CCCCRRRROOOOPPPP____RRRRIIIIGGGGHHHHTTTT,,,,
  106.      CCCCLLLL____IIIIMMMMAAAAGGGGEEEE____CCCCRRRROOOOPPPP____TTTTOOOOPPPP,,,, CCCCLLLL____IIIIMMMMAAAAGGGGEEEE____CCCCRRRROOOOPPPP____BBBBOOOOTTTTTTTTOOOOMMMM
  107.           For video compressors, these indicate how many pixels to crop
  108.           from each of the four sides of the input image.  These may be
  109.           set to any value from 0 to 4064.  On the first call to clCompress,
  110.           the cropped region is checked to make sure it is at least 16x16
  111.           pixels in size.
  112.  
  113.      CCCCLLLL____IIIINNNNTTTTEEEERRRRNNNNAAAALLLL____FFFFOOOORRRRMMMMAAAATTTT
  114.           For video, this is always CL_FORMAT_YCbCr422DC.  To be MPEG-
  115.           compliant, the bitstream is actually encoded in 4:2:0 format,
  116.           where the chroma is subsampled by 2 vertically in addition to
  117.           horizontally, but the current implementation exposes only the
  118.           duplicate chroma format.
  119.  
  120.      CCCCLLLL____BBBBIIIITTTTSSSS____PPPPEEEERRRR____CCCCOOOOMMMMPPPPOOOONNNNEEEENNNNTTTT
  121.           For audio, only 16-bit samples are supported.
  122.  
  123.      CCCCLLLL____FFFFRRRRAAAAMMMMEEEE____RRRRAAAATTTTEEEE
  124.           For compressors, this should be set to indicate the frame rate of
  125.           the input.  The following rates are allowed.
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ccccllll____mmmmppppeeeegggg1111((((3333ddddmmmm))))                                                    ccccllll____mmmmppppeeeegggg1111((((3333ddddmmmm))))
  137.  
  138.  
  139.  
  140.               Video : 23.976, 24, 25, 29.97, 30, 50, 59.94, 60
  141.               Audio : 32000, 44100, 48000
  142.  
  143.           For decompressors, this is read-only.
  144.  
  145.      CCCCLLLL____PPPPIIIIXXXXEEEELLLL____AAAASSSSPPPPEEEECCCCTTTT
  146.           Pixel aspect ratio, defined as the vertical extent of a pixel
  147.           divided by its horizontal extent.  For video compressors, this
  148.           should be set to match the aspect ratio of the input pixels.
  149.           The closest value from the following list is used.
  150.  
  151.                 1.0000   Square
  152.                 0.6735
  153.                 0.7031   16:9, 625line
  154.                 0.7615
  155.                 0.8055
  156.                 0.8437   16:9, 525line
  157.                 0.8935
  158.                 0.9157   CCIR601, 625line
  159.                 0.9815
  160.                 1.0255
  161.                 1.0695
  162.                 1.0950   CCIR601, 525line
  163.                 1.1575
  164.                 1.2015
  165.  
  166.           For video decompressors, this is read-only.
  167.  
  168.      CCCCLLLL____CCCCOOOOMMMMPPPPRRRREEEESSSSSSSSIIIIOOOONNNN____RRRRAAAATTTTIIIIOOOO
  169.           For compressors, setting this parameter will result in an
  170.           appropriate CL_BITRATE to be calculated (and vice versa).
  171.  
  172.      CCCCLLLL____EEEEXXXXAAAACCCCTTTT____CCCCOOOOMMMMPPPPRRRREEEESSSSSSSSIIIIOOOONNNN____RRRRAAAATTTTIIIIOOOO
  173.           TRUE for video and audio compressors, since bitrate targets are
  174.           generally met.  However, some deviation from the requested
  175.           compression ratio may occur due to the bitrates actually allowed
  176.           (see below).
  177.  
  178.      CCCCLLLL____BBBBIIIITTTTRRRRAAAATTTTEEEE
  179.           May be set for compressors to indicate a target bitrate.
  180.  
  181.           For compressors, setting this parameter will result in an
  182.           appropriate CL_COMPRESSION_RATIO to be calculated (and vice
  183.           versa).
  184.  
  185.           The allowed bitrates are
  186.  
  187.           Video : 100 Kbps - 4.5 Mbps
  188.           Audio : (in Kbps)
  189.            layer I  - 32, 64, 96,128,160,192,224,256,288,320,352,384,416,448
  190.            layer II - 32, 48, 56, 64, 80, 96,112,128,160,192,224,256,320,384
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ccccllll____mmmmppppeeeegggg1111((((3333ddddmmmm))))                                                    ccccllll____mmmmppppeeeegggg1111((((3333ddddmmmm))))
  203.  
  204.  
  205.  
  206.           The default bitrates are 1.158 Mbps for video and 96/192 Kbps for
  207.           mono/stereo audio.  These correspond to single-speed CD-ROM, and
  208.           work best for SIF-size images (352x240, 352x288, 320x240).  Values
  209.           of CL_INTERNAL_WIDTH and CL_INTERNAL_HEIGHT that are larger should
  210.           use higher bitrates.
  211.  
  212.           For decompressors, this is read-only.
  213.  
  214.      CCCCLLLL____NNNNUUUUMMMMBBBBEEEERRRR____OOOOFFFF____FFFFRRRRAAAAMMMMEEEESSSS
  215.           For video and audio decompressors, this parameter keeps track of
  216.           the known number of frames in the sequence.  As the sequence is
  217.           decoded, the number of frames may increase.
  218.  
  219.  
  220.  
  221.    PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS :::: MMMMPPPPEEEEGGGG----1111
  222.      This parameter is shared by the MPEG schemes.
  223.  
  224.      CCCCLLLL____MMMMPPPPEEEEGGGG1111____EEEENNNNDDDD____OOOOFFFF____SSSSTTTTRRRREEEEAAAAMMMM
  225.           Type : CL_ENUM_VALUE
  226.           A read-only parameter which indicates that the end of stream has
  227.           been reached.  Used by compressors to indicate there is no more
  228.           data to write.  Used by decompressors to indicate there is no data
  229.           left to read.
  230.  
  231.  
  232.  
  233.    PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS :::: MMMMPPPPEEEEGGGG----1111 VVVVIIIIDDDDEEEEOOOO
  234.      The following parameters apply only to the MPEG-1 Video scheme.
  235.  
  236.      CCCCLLLL____MMMMPPPPEEEEGGGG1111____VVVVIIIIDDDDEEEEOOOO____MMMM
  237.      CCCCLLLL____MMMMPPPPEEEEGGGG1111____VVVVIIIIDDDDEEEEOOOO____NNNN
  238.           Type : CL_RANGE_VALUE
  239.           Used to select IPB pattern for video compressors.  M is the
  240.           distance between reference frames (I or P), and N is the distance
  241.           between I frames, measured in numbers of frames.  M ranges from
  242.           1 to 12, and N ranges from 1 to 60.  The first call to clCompress
  243.           checks that N/M is an integer.  Default is M=4, N=16.  The actual
  244.           encoded pattern may be different due to automatic I frame insertion
  245.           at scene changes.
  246.  
  247.                M      N        Pattern
  248.                1      1        IIIIII IIIIII
  249.                1      3        IPPIPP IPPIPP
  250.                3      3        BBIBBI BBIBBI
  251.                3      6        BBIBBP BBIBBP
  252.  
  253.      CCCCLLLL____MMMMPPPPEEEEGGGG1111____VVVVIIIIDDDDEEEEOOOO____MMMMAAAAXXXX____MMMMOOOOTTTTIIIIOOOONNNN____VVVVEEEECCCCTTTTOOOORRRR____LLLLEEEENNNNGGGGTTTTHHHH____PPPP____XXXX,,,,
  254.      CCCCLLLL____MMMMPPPPEEEEGGGG1111____VVVVIIIIDDDDEEEEOOOO____MMMMAAAAXXXX____MMMMOOOOTTTTIIIIOOOONNNN____VVVVEEEECCCCTTTTOOOORRRR____LLLLEEEENNNNGGGGTTTTHHHH____PPPP____YYYY,,,,
  255.      CCCCLLLL____MMMMPPPPEEEEGGGG1111____VVVVIIIIDDDDEEEEOOOO____MMMMAAAAXXXX____MMMMOOOOTTTTIIIIOOOONNNN____VVVVEEEECCCCTTTTOOOORRRR____LLLLEEEENNNNGGGGTTTTHHHH____BBBB____XXXX,,,,
  256.      CCCCLLLL____MMMMPPPPEEEEGGGG1111____VVVVIIIIDDDDEEEEOOOO____MMMMAAAAXXXX____MMMMOOOOTTTTIIIIOOOONNNN____VVVVEEEECCCCTTTTOOOORRRR____LLLLEEEENNNNGGGGTTTTHHHH____BBBB____YYYY
  257.           Type : CL_RANGE_VALUE
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. ccccllll____mmmmppppeeeegggg1111((((3333ddddmmmm))))                                                    ccccllll____mmmmppppeeeegggg1111((((3333ddddmmmm))))
  269.  
  270.  
  271.  
  272.           For video compressors, the maximum search range (in pixels) for
  273.           motion vectors.  Vectors in P frames have maximum lengths of P_X
  274.           and P_Y, and in B frames have maximum lengths of B_X and B_Y.
  275.           Higher values may give better image quality at the expense of more
  276.           computation.  Allowable parameter values range from 1 to 60.
  277.           Defaults are P_X=48, P_Y=32, B_X=32, and B_Y=24.
  278.  
  279.      CCCCLLLL____MMMMPPPPEEEEGGGG1111____VVVVIIIIDDDDEEEEOOOO____SSSSOOOOFFFFTTTTNNNNEEEESSSSSSSS
  280.           Type : CL_ENUM_VALUE
  281.           The smoothing filter parameter for video compressors.  May be set
  282.           to one of
  283.  
  284.                 CL_MPEG1_VIDEO_SOFTNESS_NONE (default)
  285.                 CL_MPEG1_VIDEO_SOFTNESS_MEDIUM
  286.                 CL_MPEG1_VIDEO_SOFTNESS_MAXIMUM
  287.  
  288.           Setting this parameter modifies the filter that is applied when
  289.           scaling from the cropped window to the internal dimensions.
  290.  
  291.  
  292.  
  293.    PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS :::: MMMMPPPPEEEEGGGG----1111 AAAAUUUUDDDDIIIIOOOO
  294.      The following parameters apply only to the MPEG-1 Audio scheme.
  295.  
  296.      CCCCLLLL____MMMMPPPPEEEEGGGG1111____AAAAUUUUDDDDIIIIOOOO____LLLLAAAAYYYYEEEERRRR
  297.           Type : CL_ENUM_VALUE
  298.           The layer used for audio encoding.  Allowed values are
  299.  
  300.                  CL_MPEG1_AUDIO_LAYER_I
  301.                  CL_MPEG1_AUDIO_LAYER_II
  302.  
  303.           For compressors this may be set to select the layer.  For
  304.           decompressors, this is a read-only parameter.
  305.  
  306.      CCCCLLLL____MMMMPPPPEEEEGGGG1111____AAAAUUUUDDDDIIIIOOOO____MMMMOOOODDDDEEEE
  307.           Type : CL_ENUM_VALUE
  308.           The mode in which input channel(s) are encoded.  Allowed values are
  309.  
  310.                  CL_MPEG1_AUDIO_MODE_STEREO
  311.                  CL_MPEG1_AUDIO_MODE_JOINT
  312.                  CL_MPEG1_AUDIO_MODE_DUAL
  313.                  CL_MPEG1_AUDIO_MODE_SINGLE
  314.  
  315.           For compressors, this may be set to select the encoding mode.
  316.           Stereo channels should be encoded with CL_MPEG1_AUDIO_MODE_STEREO
  317.           or CL_MPEG1_AUDIO_MODE_JOINT.  The latter exploits correlation
  318.           between channels for more compression.  Two independent channels
  319.           should be encoded with CL_MPEG1_AUDIO_MODE_DUAL.  A mono signal
  320.           should be encoded with CL_MPEG1_AUDIO_MODE_SINGLE.
  321.  
  322.           For decompressors, this is a read-only parameter.
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. ccccllll____mmmmppppeeeegggg1111((((3333ddddmmmm))))                                                    ccccllll____mmmmppppeeeegggg1111((((3333ddddmmmm))))
  335.  
  336.  
  337.  
  338. NNNNOOOOTTTTEEEESSSS
  339.      This section provides miscellaneous information and tips on how to use
  340.      the MPEG schemes.
  341.  
  342.  
  343.    EEEErrrrrrrroooorrrr CCCCooooddddeeeessss
  344.      CL_BAD_LICENSE may be returned by clOpenCompressor if the appropriate
  345.      license is not installed.
  346.  
  347.      CL_MPEG1_ERROR may be returned by a CL call if an MPEG-specific error
  348.      occurs, e.g. a non-compliant data stream.
  349.  
  350.  
  351.    VVVViiiiddddeeeeoooo CCCCoooommmmpppprrrreeeessssssssiiiioooonnnn
  352.      Since the MPEG video compressor reorders input frames, compressed bits
  353.      that are generated by a call to clCompress do not necessarily correspond
  354.      to the frame that is consumed from the input buffer.
  355.  
  356.      The compressor maps the cropped window to the internal width and height.
  357.      If the cropped window and the internal dimensions are not related by the
  358.      same scale factor in each dimension, the final image is stretched more
  359.      along one axis than the other.
  360.  
  361.  
  362.  
  363. FFFFIIIILLLLEEEESSSS
  364.      /usr/include/dmedia/cl.h
  365.  
  366.  
  367. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  368.      CLintro(3dm), mpeg(4)
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.